---
id: use-stacks
title: useStacks
---

`useStacks` returns the `Stacks` context object.

### TypeScript

```typescript
type Breakpoint = [string, number]

type Context = {
  readonly debug: boolean
  readonly spacing: number
  readonly breakpoints: readonly Breakpoint[]
  readonly dimensions: ReactNative.ScaledSize
}

const useStacks: () => Context
```

### ReScript

```typescript
type breakpoint = (string, number)
type breakpoints = array<breakpoint>

type context = {
  debug: bool,
  spacing: float,
  breakpoints: breakpoints,
  dimensions: ReactNative.Dimensions.displayMetrics,
}

let useStacks: unit => context
```

### Basic usage

```jsx live
const DebugText = () => {
  const context = useStacks()

  return (
    <Typography variant="body">{JSON.stringify(context)}</Typography>
  )
}

const App = () => {
  return (
    <StacksProvider spacing={4}>
      <DebugText />
    </StacksProvider>
  )
}

render(<App />)
```
